package com.system.module.common.controller;

import com.system.framework.web.domain.Result;
import com.system.module.common.service.ICommonDataService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 验证码操作处理
 *
 * @author 程序员Mars
 */
@RequestMapping(value = "/common", produces = "application/json")
@AllArgsConstructor
@RestController
public class CaptchaController {

    private final ICommonDataService commonDataService;

    /**
     * 生成验证码
     */
    @GetMapping("/captcha/acquire")
    public Result getCode() {
        return Result.success(commonDataService.acquire());
    }
}
